Update apply.c

Fixed a REALLY ridiculous bug :(