Added tests and fixed navigation events