Fix for issues #129 and #130

Fix for issues #129 and #130