P0019 minor fix and add test cases