Fixing unit bug in aperture photometry