cleanups + fixes + arrays