Moved to /lib directory + some fixes