Small fix to javafx frame capture.