Implement all fixes from ends-issue