Fixed part of issues from #234