Style updates
Fixed logic bugs