Minor fixes for warnings and error propagation