Merge various changes from #23