found and fix one potential bug and added two tests to back it up

@lauraxt r?