Fixed issues #16 and #17

#16
#17