Fixed some minor bugs.
Still bugs in datalinklayer which causes some wierd behavior sometimes.