checkin some old changes, fixes #417