Fixing #35, #31