Fixes for issues 13 and 14