Fixing sub pixel problem