Fix braindead and broken way to calculate abase, fixes regression tests on