Cleaned up compiler warnings and fixed setItem bug with arguments in wrong order