Removed bad exception and improved all gem versions support