updated semantics tests and fixed semantics-related bugs