bug fixes

fixing issues #2 and #3