Fixes in drawing logic