fix a bad cast to Assignment, closes #1935