Fixed a stupid bug and cleaned examples