Fix #332; add more helpful errors