Fix issue #31 through major redesign of generate slots