style and semantics fixes