Bug Fixes

Fix for error #264 
Fix for error #271