Fixed a bug in path drawing