fix some pixel width calculation issues