Closes #564

Also, get up to date with master