Fix errors and new package structure