Fixes various issues around #12.