Issue 506 fixing conflicts with master