Fixed issue #33 again and #31 additionally