Fixed warnings in drawing logic