Fixed issues #27 and #28