Some Angular js bugs fixed