Fixed #1854 by using wizzud's suggestion. The only real difference is the code is...