BUG: scale iterator was not reset
BUG: ifndef error