Fix for IZPACK-1015

Cherry picked changes by Juraj Oprsal from https://github.com/izpack/izpack/pull/128