Closed #43, various fixes