add test catching a bug.
added script for verification of bug.
fixed a bug