Fixed compile error, added missing license headers and organized imports