Fixed unit tests
Added first tests for apply command