Bug fixes, still does not work coorrectly...