Fix some close behaviour

Merge JavaFX8 branch