Fix #235 and other changes