Added use of Guard module, bug fixes