fixed a lot of bugs
package changes plus a few more bug fixes