Resolved a few problems with pg gems