Fixed some bugs in photometry, now uses correct file and has a minimum error