minor bug fixs
major improvement of module system