merge hemp, various bug fixes