Fix bug with extends. Fixes issue with added space with extend. Now all unit tests pass again
Fix another extend issue - Fixes #1404