Slight bug fix, still chasing errors