Simplification and fixes