Fixed error while changing style without form loaded.