Tested and Fixed #826