Fixes some issues from #1.