Improvements with type matching and stuff