Added test exposing bug when renaming a directory to a new parent.
Fixed bug when renaming a directory to a new parent.