Fixed Issue #652, #1091 

 Fixed Issue #652, #1091