Removed compilation warning and do not split window randomly.