Fixed some stupid logic