Fix warnings, missing methods, modernize code