Added test, fixed CR feedback, cleanup