Issues #17 and #16 fixed