Fixes #2 and #1 hopefully.