Test codes for #1018 & #1019

These are the unit test for the issues #1018 & #1019