Fixed stacklevel for warnings + fixed another type error