fixed systems macros and added test for systems