Fixed bug in destow()/restow()