Workarounds for #128 and #129

Please review before merging!