Fixed before actions, gems, and redundant id calls