Added tests and fixed implementation in Ctrl