(Contributed by Akira Ajisaka via Daniel Templeton) (cherry picked from commit 73ecb19312879d54e1cbe80199fe950d81c81104)