Tests added and some fix