Fixes most of #4