#1 optimization, fixes