Fixed bug fix to #762