Fixing issues #21 and #23