ack's fix + more tests for various cases